home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk20 / libcat12 / query.doc < prev    next >
Text File  |  1995-03-18  |  13KB  |  266 lines

  1.                               Query Instructions
  2.        
  3.        
  4.        The Query program will  allow  you  to  produce a report based on
  5.        your selection,  sorting  and  formatting  specifications.   Upon
  6.        entry, you will be presented  with  a  data dictionary and string
  7.        gadgets  for  entering  your  record   selection  criteria,  sort
  8.        sequence and output report format.
  9.        
  10.        The data dictionary presents  you  with a list of data names that
  11.        can be used to display or print values contained in the database.
  12.        
  13.        The SELECT string gadget will allow you to specify some selection
  14.        criteria to be used to determine which  database  entries will be
  15.        included in you output display or report.  For example,
  16.        
  17.             SELECT:
  18.             (Author = "Smith" or "Jones") and Year < "1900"
  19.        
  20.        specifies that the database  is  to  be  searched for all Authors
  21.        with the name of Smith or Jones whose work was published prior to
  22.        1900.  Remember that in order to enter  data into a string gadget
  23.        you must first position the pointer within the gadget and depress
  24.        the left button on the mouse.   Note  that  the Select parameters
  25.        contain  parentheses  to  prevent  ambiguities.   If  there  is a
  26.        possibility that the  key  word  or  phrase  you  are looking for
  27.        contains occurrences with both upper  and lower case letters, you
  28.        must check for both, e.g., "Smith" or "smith".  Another method is
  29.        to use the wild character, e.g., "?mith".
  30.        
  31.        The SORT string gadget will allow  you to specify the sequence in
  32.        which the selected records are  to  be displayed or printed.  For
  33.        example,
  34.        
  35.             SORT:
  36.             Title
  37.        
  38.        specifies that the selected database  entries are to be sorted in
  39.        Title sequence.  Only one sort field may be entered.
  40.        
  41.        The REPORT string gadget will allow  you to specify the format of
  42.        the output display or report.  For example,
  43.        
  44.             REPORT:
  45.             Classification, col 10, Author, col 50, Year
  46.        
  47.        specifies  that  the  Classification,  Author  and  Year  for the
  48.        selected entries are to be  displayed.   Further, it is specified
  49.        that the Author is to  be  displayed  beginning  in column 10 and
  50.        that the Year is to be displayed beginning  in column 50.  If the
  51.        column parameters are omitted,  the  data items will be separated
  52.        with  one  space  in  the   output.    The  Report  specification
  53.        parameters may be very simple or very  complex depending upon the
  54.        skill of the user.
  55.        
  56.        Upon entering the Query  program,  you will find that the SELECT,
  57.        SORT   and   REPORT   string   gadgets   already   contain   some
  58.        parameters.These  parameters  have  been  designed  to  provide a
  59.        simple display of all the  entries  in  the catalog.  You may use
  60.        these parameters simply by  selecting  the run gadget, or you may
  61.        enter your own customized  report  specifications.   To erase the
  62.        content on the parameter string gadgets,  first select the gadget
  63.        and then depress Right AMIGA  -  X.   To  undo  (cancel) the last
  64.        editing change to  the  string,  depress  Right  AMIGA  - Q.  The
  65.        Report  specification  parameters  can  be  classified  as either
  66.        describing "when to do it" or "what to do".
  67.        
  68.        When To Do It:
  69.                 
  70.                 page_top - specifies that subsequent functions are to be
  71.                 executed at the top each printed page or screen.
  72.                 
  73.                 page_bottom - specifies that subsequent functions are to
  74.                 the executed  at  the  bottom  of  each  printed page or
  75.                 screen.
  76.                 
  77.                 report_top - specifies that subsequent  functions are to
  78.                 be executed only at the beginning of the output report.
  79.                 
  80.                 report_bottom - specifies that  subsequent functions are
  81.                 to executed only at the end of the report.
  82.                 
  83.                 top(<data-name>) -  specifies  that subsequent functions
  84.                 are to be executed after there  has been a change in the
  85.                 content of <data-name>.   For  example,  top(Publisher).
  86.                 Normally, the specified  data-name  will  be the same as
  87.                 the sort sequence.
  88.                 
  89.                 bottom(<data-name>)   -   specifies    that   subsequent
  90.                 functions are to be executed before there is a change in
  91.                 the content of data-name.  For example, bottom(Year).
  92.                 
  93.                 detail - specifies that the subsequent  functions are to
  94.                 be executed for each selected database entry.
  95.                 
  96.        What To Do:
  97.        
  98.                 print - specifies that all output is to be routed to the
  99.                 printer.  Default values  for  tm, bm and bod are set to
  100.                 4, 8, and 54 respectively.
  101.                 
  102.                 display - specifies that  all  output is to be routed to
  103.                 the screen.  "Display" is  the  output default.  Default
  104.                 values for tm,  bm  and  bod  are  set  to  0, 0, and 22
  105.                 respectively.
  106.                 
  107.                 tm nn - sets the top  margin  for  the output display or
  108.                 report to the value specified by nn.
  109.                 
  110.                 bm nn - sets the bottom margin for the output display or
  111.                 report to the value specified by nn.
  112.                 
  113.                 bod nn - sets the body of  the  output display or report
  114.                 to the value specified by nn.  The sum of tm, bm and bod
  115.                 must equal the desired page length.
  116.                 
  117.                 <data-name> -  causes  the  specified  data  name  to be
  118.                 printed  or  displayed.   For   example,  "Title"  is  a
  119.                 data-name.
  120.                 
  121.                 "literal" - causes the  specified  literal to be printed
  122.                 or  displayed.   For  example,  "The  result  is:"  is a
  123.                 literal.
  124.                 
  125.                 trim(<data-name>) - causes the specified data name to be
  126.                 printed or displayed after all trailing spaces have been
  127.                 eliminated.
  128.                 
  129.                 total(<data-name>) - specifies  that the summed value of
  130.                 <data-name> is to be  printed  or displayed.  An numeric
  131.                 data item  from the dictionary or a numeric literal must
  132.                 be substituted for <data-name>.  For example, to print a
  133.                 count of the entries selected for the report enter:
  134.                 
  135.                        report_bottom total(1) "%9999"
  136.                 
  137.                 cum(<data-name>)  -   same  as  total  except  that  the
  138.                 accumulator is not reset  after  displaying  the result.
  139.                 To consecutively  number  item  appearing  in the output
  140.                 report, enter:
  141.                 
  142.                        detail cum(1) "%999"
  143.                 
  144.                 spacer nn - causes  nn  spaces  to  be  inserted between
  145.                 output data items.  The default is 1.
  146.                 
  147.                 col nn - causes  the  next  specified  data  item  to be
  148.                 displayed or printed in the column specified by nn.
  149.                 
  150.                 skip n - causes n lines to be  skipped before displaying
  151.                 or printing the next data item.  If n is not provided, 1
  152.                 is assumed.
  153.                 
  154.                 pause - causes a pause in the output process until a key
  155.                 (any key) is depressed.
  156.                 
  157.                 eject - if "print"  has  been  specified,  this  command
  158.                 causes the paper to be  ejected  to  the top of the next
  159.                 page; otherwise, the screen will be cleared.
  160.                 
  161.                 
  162.                 EDITING MASKS
  163.                 
  164.                 Numeric Editing Masks may  be  used  to cause predefined
  165.                 characters to be imbedded  within  displayed  or printed
  166.                 numeric items.  Numeric items are identified in the data
  167.                 dictionary with  the  character  "n"  following the data
  168.                 name.  The masks must be constructed  as an alphanumeric
  169.                 literal whose  first  character  is  "%".  If the second
  170.                 character of the mask  literal  is  other than a numeric
  171.                 character, that  character  will  be  placed in the next
  172.                 left most position before  the  resulting edited numeric
  173.                 value.
  174.                 
  175.                 Examples:
  176.                 
  177.                      Input Values       Mask         Output
  178.                 
  179.                          01000        "%9,999"        1,000
  180.                 
  181.                          25245      "%$99,999"      $25,245
  182.                 
  183.                          -5643     "%$999,999"      $-5,643
  184.                 
  185.                 Alphanumeric  Editing   Masks   may  be  used  to  cause
  186.                 predefined characters to be imbedded within displayed or
  187.                 printed  alphanumeric  items.   Alphanumeric  items  are
  188.                 identified in the data dictionary with the character "c"
  189.                 following the data name.   The  mask must be constructed
  190.                 as an alphanumeric literal whose first character is "%".
  191.                 
  192.                 Examples:
  193.                 
  194.                      Input Values        Mask        Output
  195.                 
  196.                        123456789     "%@@@-@@-@@@@"  123-45-6789
  197.                 
  198.                        102786        "%@@/@@/@@"     10/27/86
  199.                 
  200.        
  201.        Here is an example of a  more  complex  query  that print a spine
  202.        label for the selected entries:
  203.        
  204.        
  205.        SELECT:
  206.        Classification > "1000000" and Classification < "2000000"
  207.        
  208.        SORT:
  209.        Classification
  210.        
  211.        REPORT:
  212.        print tm 1 bod 4 bm 1 col 14 Classification "%@@@.@@@@" skip
  213.              col 16 Author "%@@@" eject
  214.        
  215.        NOTE:  The decimal  point  is  not  physically  contained  in the
  216.        database; consequently an  edit  mask  is  used  to insert it for
  217.        output purposes.
  218.        
  219.        These parameters are set  for  5/16  x  3 1/2 in. address labels.
  220.        For other sizes of labels,  simply  adjust the margin parameters.
  221.        Note that an edit mask is  used  to  select  only the first three
  222.        characters of the author's name.
  223.        
  224.        
  225.        Rules:
  226.        
  227.             (1)  The Select statement may contain these operators:
  228.        
  229.                     =  Equal to
  230.                     <> Unequal to
  231.                     <  Less than
  232.                     >  Greater than
  233.                     <= Less than or equal to
  234.                     >= Greater than or equal to
  235.        
  236.             (2)  The field on the left side  of  the  operator must be a
  237.        data name from the dictionary.
  238.        
  239.             (3)  The field on the  right  side  of  the  operator may be
  240.        either a data name or  literal.    Literals  must  be enclosed in
  241.        double quotes.
  242.        
  243.             (4)  In the case of equal and unequal,  the data name on the
  244.        left side of the operator is searched  for any occurrences of the
  245.        data specified on the right of the operator.
  246.        
  247.             (5)  The length of the item to the right of the operator may
  248.        not be greater than the  length  of  the  item to the left of the
  249.        operator.
  250.        
  251.             (6)  When used in a literal, the "?"  is wild.  For example,
  252.        to select all records in the database enter:
  253.        
  254.                    SELECT:
  255.                    Author  = "?"
  256.        
  257.             (7)  Commas may used to improve readability; otherwise, they
  258.        serve no useful purpose.
  259.        
  260.             (8)  All data names must be capitalized.  All other commands
  261.        must be in lower case.
  262.        
  263.        If your printer carriage is 80 columns in width, try setting your
  264.        printer preferences for compressed mode in order to print reports
  265.        that are greater than 80 characters in width.
  266.